package leetcode;

import pojo.TreeNode;

/**
 * 104. 二叉树的最大深度    https://leetcode.cn/problems/maximum-depth-of-binary-tree/
 *
 * @author yujiafan
 * @version 1.0.0
 * @create 2022-12-27
 */
public class LeetCode104 {

    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        return Math.max(maxDepth(root.left) + 1, maxDepth(root.right) + 1);
    }
}
